package tt.doubleagent.game;

import java.util.ArrayList;

import tt.doubleagent.data.WordPair;

public class GameControllerV1 implements GameController {

	
	private static GameControllerV1 mInstance=null;
	public GameControllerV1()
	{
		
		
	}
	
	public static GameControllerV1 getInstance()
	{
		if(mInstance==null)
			mInstance=new GameControllerV1();
		return mInstance;
	}
	// rule id is used to identify the current game controller rules, like if
	// rule ID=1, judge constantly equals to 0.
	int ruleID = 0;

	int totalPlayers = 0;
	public int TotalPlayersUpperThreshold=14;
	int majority = 0;
	int minority = 0;
	int agent = 0;
	int judge = 0;

	WordPair currentWordPair = null;

	// an array to store players info
	ArrayList<Player> positionedPlayerList = null;
	// used to identify the current displayed player's position in positioned
	// player list
	int currentDisplayedPlayerPosition = 0;

	int currentWordPackageID = 0;

	int[] majoritySuggestedCount = new int[] { 0, 0, 0, 0, 3, 4, 4, 4, 5, 6, 7,
			7, 6, 7, 8, 10, 9 };
	int[] minoritySuggestedCount = new int[] { 0, 0, 0, 0, 3, 4, 4, 4, 5, 6, 7,
			7, 6, 7, 8, 10, 9 };
	int[] agentSuggestedCount = new int[] { 0, 0, 0, 0, 3, 4, 4, 4, 5, 6, 7, 7,
			6, 7, 8, 10, 9 };

	@Override
	public void setTotalPlayersCount(int num) {
		// TODO Auto-generated method stub
		totalPlayers = num;
	}

	@Override
	public void setMajorityCount(int num) {
		// TODO Auto-generated method stub
		majority = num;
	}

	@Override
	public void setMinorityCount(int num) {
		// TODO Auto-generated method stub
		minority = num;
	}

	@Override
	public void setAgentCount(int num) {
		// TODO Auto-generated method stub
		agent = num;
	}

	@Override
	public void setJudgeCount(int num) {
		// TODO Auto-generated method stub
		judge = num;
	}

	@Override
	public int getMajorityCount() {
		// TODO Auto-generated method stub
		return majority;
	}

	@Override
	public int getMinorityCount() {
		// TODO Auto-generated method stub
		return minority;
	}

	@Override
	public int getAgentCount() {
		// TODO Auto-generated method stub
		return agent;
	}

	@Override
	public int getJudgeCount() {
		// TODO Auto-generated method stub
		return judge;
	}

	@Override
	public void setSuggestedRolePlayersCount() {
		// TODO Auto-generated method stub
		majority = majoritySuggestedCount[totalPlayers];
		minority = minoritySuggestedCount[totalPlayers];
		agent = agentSuggestedCount[totalPlayers];
	}

	@Override
	public Player displayNextPlayer() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int setCurrentDisplayedPlayerPosition(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void generatePlayers() {
		// TODO Auto-generated method stub

	}

	@Override
	public void shufflePlayerWords() {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean setPlayerAttributes(int playerPosition, Player player) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public GameResult checkGameStatus() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean sendPlayerInfo(Player player) {
		// TODO Auto-generated method stub
		return false;
	}

}
